/*
 * Design by  free.wang <freefis@gmail.com>
 * Licence unser BSD  lisence
 * Complete on May 30 21:30 , 2009 
 *
 * Environment:
 *     GCC 4.3.2
 *     Ubuntu / Linux i386
 *     Mac OS X / FreeBSD 4.x
 */

#include "cross.h"     
#include "mutate.h"     
//#include "mutate.h"



/*
double  example[3][6] = {
                         {1000,1001,1002,1003,1004,1990},
                         {10  ,11  ,12  ,12  ,13  ,14  },
                         {0   ,1   ,2   ,0   ,1   ,2   },
                        };
*/


void get_best_by_variate(){
	// do sth.
}

plt * cross()
{
	/* population = [seed_0.....seed_n]
	 * population:种 群
	 * seed 个 体
	 */
  
	plt * ExamplePopulation[100]; 
	generate_example_population(ExamplePopulation);
	
	plt * Top5Population[5];   
	
	/*  2.
		after this step,The Best 5 Population were copied
	 	to Top5Population from ExamplePopulation 
	*/
    natural_selection( Top5Population,ExamplePopulation );
          
    /*  3.
        Cross the Top 5 Populations =>  1 Best Population
	*/
	plt * BestPopulation = init_plt();
	BestPopulation = cross_best(Top5Population);

	pltshow(BestPopulation);
	return BestPopulation;
}
                  

int main(){
	double seed[3][6];
    generate_seed(seed);  

	
	int i,j;
    printf("{\n");         	
    for(j=0;j<3;j++){
        for(i=0;i<6;i++)
            printf("\t%d", (int)(seed[j][i]) );
        printf("\n");
    }
    printf("}\n");

    return 0;
}



